<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>资讯列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style>
		#news{width:880px;line-height:35px;}
		#nk{position:absolute;top:240px;left:305px;}
		#nk>p{font-size:16px;margin:-30px 0 40px -40px;font-weight:bold;}
		#paging{margin:-56px 8% -46px 0;}
		#add{position:absolute;top:-20px;left:840px;border:none;background-color:#fff;}
		#addNews{display:none;}
		#addNews {border: 1px solid #F5F5F5;background-color:#F5F5F5;width: 660px;height: 400px;position: absolute;top: 300px;left: 400px;color:red;}
		#addNews form{line-height: 100px;margin-left: 30%;}
		#addNews td {line-height: 40px;}
		#addNews table {margin-left: -50px;margin-top: 40px;}
		#date{padding:10px 0;}
		#zi{color:#000;font-size:16px;margin-left:20px;}
		#close{margin-left:560px;position:relative;top:-18px;}
		#close:hover{cursor: pointer;}
		#addbtn {position: relative;left:400px;top:10px;}		
	</style>
	<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="js/newsList.js"></script>
	<script type="text/javascript">
		function add(){
			$("#addNews").show();
			$("#nk").hide();
			$("#paging").hide();
		};
		$(function(){
			$("#close").click(function(){
				$("#addNews").hide();
				$("#nk").show();
				$("#paging").show();
			});
			$("form").submit(function(){
				if($("#title").val()==""){
					alert("标题不能为空！");
					return false;	
				}
				else if($("#content").val()==""){
					alert("内容不能为空！");
					return false;
				}
				else if($("#createTime").val()==""){
					alert("录入日期不能为空！");
					return false;
				}
			});
		});
	</script>
  </head>
  
  <body>
    <%@ include file="topBar.jsp" %>
    <%@ include file="leftBar.jsp" %>
    <c:if test="${not empty param.mess}">
  		<script>alert("${param.mess}");</script>
  	</c:if>
    <div id="nk">
    	<p>资讯列表</p><input type="button" value="添加资讯" id="add" onclick="add()"/>
    	<table id="news" bordercolor="#F1F1F1" border="1" cellpadding="6" style="border-collapse:collapse;" cellspacing="0">
    		
    	</table>
    </div>
    <div id="addNews">
    <p id="zi">资讯信息<span id="close">×</span></p>
    	<form action="news?opr=addNews" method="post">
	    	<table>
	    		<tr>
	    			<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;标题：
	    				<textarea rows="3" cols="40" id="title" name="title"></textarea>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;内容：
	    				<textarea rows="6" cols="40" id="content" name="content"></textarea>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td id="date">录入日期：
	    				<input type="date" id="createTime" name="createTime"/>
	    			</td>
	    		</tr>
	    		<tr>
		    		<td><input type="submit" value="添加" id="addbtn"/></td>
		    	</tr>
	    	</table>
    	</form>
    </div>
    <div class="pages" id="paging">

	</div>
    <%@ include file="bottomBar.jsp" %>
  </body>
</html>
